<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>生产监控 - 智能制造分析系统</title>

  <!-- Google Font: Source Sans Pro -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@3.2.0/dist/css/adminlte.min.css">
  <!-- Select2 -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ttskch/select2-bootstrap4-theme@x.x.x/dist/select2-bootstrap4.min.css">
  <!-- Chart.js -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/chart.js@3.7.0/dist/chart.min.css">
</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
  <!-- Navbar -->
  <nav class="main-header navbar navbar-expand navbar-white navbar-light">
    <!-- Left navbar links -->
    <ul class="navbar-nav">
      <li class="nav-item">
        <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
      </li>
    </ul>

    <!-- Right navbar links -->
    <ul class="navbar-nav ml-auto">
      <li class="nav-item">
        <a class="nav-link" data-widget="fullscreen" href="#" role="button">
          <i class="fas fa-expand-arrows-alt"></i>
        </a>
      </li>
    </ul>
  </nav>
  <!-- /.navbar -->

  <!-- Main Sidebar Container -->
  <aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="../index.html" class="brand-link">
      <img src="https://adminlte.io/themes/v3/dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
      <span class="brand-text font-weight-light">智能制造分析</span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
      <!-- Sidebar Menu -->
      <nav class="mt-2">
        <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
          <li class="nav-item">
            <a href="dashboard.html" class="nav-link active">
              <i class="nav-icon fas fa-tachometer-alt"></i>
              <p>生产监控</p>
            </a>
          </li>
          <li class="nav-item">
            <a href="yield-analysis.html" class="nav-link">
              <i class="nav-icon fas fa-chart-pie"></i>
              <p>良率分析</p>
            </a>
          </li>
          <li class="nav-item">
            <a href="equipment-maintenance.html" class="nav-link">
              <i class="nav-icon fas fa-tools"></i>
              <p>设备维护</p>
            </a>
          </li>
          <li class="nav-item">
            <a href="data-source.html" class="nav-link">
              <i class="nav-icon fas fa-database"></i>
              <p>数据源配置</p>
            </a>
          </li>
          <li class="nav-item">
            <a href="system-settings.html" class="nav-link">
              <i class="nav-icon fas fa-cog"></i>
              <p>系统设置</p>
            </a>
          </li>
          <li class="nav-header">AI功能</li>
          <li class="nav-item">
            <a href="ai/model-management.html" class="nav-link">
              <i class="nav-icon fas fa-brain"></i>
              <p>模型管理</p>
            </a>
          </li>
          <li class="nav-item">
            <a href="ai/prediction-analysis.html" class="nav-link">
              <i class="nav-icon fas fa-chart-line"></i>
              <p>预测分析</p>
            </a>
          </li>
        </ul>
      </nav>
      <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1>生产监控</h1>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="#">首页</a></li>
              <li class="breadcrumb-item active">生产监控</li>
            </ol>
          </div>
        </div>
      </div>
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <!-- 生产概览 -->
        <div class="row">
          <div class="col-lg-3 col-6">
            <div class="small-box bg-info">
              <div class="inner">
                <h3>150</h3>
                <p>今日产量</p>
              </div>
              <div class="icon">
                <i class="fas fa-industry"></i>
              </div>
              <a href="#" class="small-box-footer">
                更多信息 <i class="fas fa-arrow-circle-right"></i>
              </a>
            </div>
          </div>
          <div class="col-lg-3 col-6">
            <div class="small-box bg-success">
              <div class="inner">
                <h3>98.5%</h3>
                <p>良率</p>
              </div>
              <div class="icon">
                <i class="fas fa-chart-pie"></i>
              </div>
              <a href="#" class="small-box-footer">
                更多信息 <i class="fas fa-arrow-circle-right"></i>
              </a>
            </div>
          </div>
          <div class="col-lg-3 col-6">
            <div class="small-box bg-warning">
              <div class="inner">
                <h3>95%</h3>
                <p>设备利用率</p>
              </div>
              <div class="icon">
                <i class="fas fa-tools"></i>
              </div>
              <a href="#" class="small-box-footer">
                更多信息 <i class="fas fa-arrow-circle-right"></i>
              </a>
            </div>
          </div>
          <div class="col-lg-3 col-6">
            <div class="small-box bg-danger">
              <div class="inner">
                <h3>2</h3>
                <p>异常预警</p>
              </div>
              <div class="icon">
                <i class="fas fa-exclamation-triangle"></i>
              </div>
              <a href="#" class="small-box-footer">
                查看详情 <i class="fas fa-arrow-circle-right"></i>
              </a>
            </div>
          </div>
        </div>

        <!-- 生产趋势 -->
        <div class="row">
          <div class="col-md-8">
            <div class="card">
              <div class="card-header">
                <h3 class="card-title">生产趋势</h3>
                <div class="card-tools">
                  <button type="button" class="btn btn-tool" data-card-widget="collapse">
                    <i class="fas fa-minus"></i>
                  </button>
                </div>
              </div>
              <div class="card-body">
                <div class="chart">
                  <canvas id="productionTrendChart" style="min-height: 250px; height: 250px; max-height: 250px; max-width: 100%;"></canvas>
                </div>
              </div>
            </div>
          </div>
          <div class="col-md-4">
            <div class="card">
              <div class="card-header">
                <h3 class="card-title">生产状态</h3>
                <div class="card-tools">
                  <button type="button" class="btn btn-tool" data-card-widget="collapse">
                    <i class="fas fa-minus"></i>
                  </button>
                </div>
              </div>
              <div class="card-body">
                <div class="chart">
                  <canvas id="productionStatusChart" style="min-height: 250px; height: 250px; max-height: 250px; max-width: 100%;"></canvas>
                </div>
              </div>
            </div>
          </div>
        </div>

        <!-- 生产计划与预警 -->
        <div class="row">
          <div class="col-md-6">
            <div class="card">
              <div class="card-header">
                <h3 class="card-title">今日生产计划</h3>
                <div class="card-tools">
                  <button type="button" class="btn btn-tool" data-card-widget="collapse">
                    <i class="fas fa-minus"></i>
                  </button>
                </div>
              </div>
              <div class="card-body p-0">
                <div class="table-responsive">
                  <table class="table m-0">
                    <thead>
                      <tr>
                        <th>产品型号</th>
                        <th>计划数量</th>
                        <th>完成数量</th>
                        <th>完成率</th>
                      </tr>
                    </thead>
                    <tbody>
                      <tr>
                        <td>产品A</td>
                        <td>100</td>
                        <td>80</td>
                        <td><span class="badge badge-success">80%</span></td>
                      </tr>
                      <tr>
                        <td>产品B</td>
                        <td>150</td>
                        <td>70</td>
                        <td><span class="badge badge-warning">47%</span></td>
                      </tr>
                      <tr>
                        <td>产品C</td>
                        <td>200</td>
                        <td>0</td>
                        <td><span class="badge badge-danger">0%</span></td>
                      </tr>
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
          </div>
          <div class="col-md-6">
            <div class="card">
              <div class="card-header">
                <h3 class="card-title">预警信息</h3>
                <div class="card-tools">
                  <button type="button" class="btn btn-tool" data-card-widget="collapse">
                    <i class="fas fa-minus"></i>
                  </button>
                </div>
              </div>
              <div class="card-body p-0">
                <div class="table-responsive">
                  <table class="table m-0">
                    <thead>
                      <tr>
                        <th>时间</th>
                        <th>类型</th>
                        <th>描述</th>
                        <th>状态</th>
                      </tr>
                    </thead>
                    <tbody>
                      <tr>
                        <td>10:30</td>
                        <td><span class="badge badge-danger">设备</span></td>
                        <td>设备A-001温度异常</td>
                        <td><span class="badge badge-warning">处理中</span></td>
                      </tr>
                      <tr>
                        <td>09:15</td>
                        <td><span class="badge badge-warning">质量</span></td>
                        <td>产品B良率下降</td>
                        <td><span class="badge badge-success">已解决</span></td>
                      </tr>
                      <tr>
                        <td>08:45</td>
                        <td><span class="badge badge-info">物料</span></td>
                        <td>原材料库存不足</td>
                        <td><span class="badge badge-warning">处理中</span></td>
                      </tr>
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
          </div>
        </div>

        <!-- AI预测建议 -->
        <div class="row">
          <div class="col-12">
            <div class="card">
              <div class="card-header">
                <h3 class="card-title">AI预测建议</h3>
                <div class="card-tools">
                  <button type="button" class="btn btn-tool" data-card-widget="collapse">
                    <i class="fas fa-minus"></i>
                  </button>
                </div>
              </div>
              <div class="card-body">
                <div class="alert alert-info alert-dismissible">
                  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                  <h5><i class="icon fas fa-info"></i> 生产建议!</h5>
                  根据历史数据分析，建议调整产品B的生产计划，预计今日完成率可能低于60%。
                </div>
                <div class="alert alert-warning alert-dismissible">
                  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                  <h5><i class="icon fas fa-exclamation-triangle"></i> 设备预警!</h5>
                  AI预测设备A-001可能在2小时内发生故障，建议提前进行维护检查。
                </div>
                <div class="alert alert-success alert-dismissible">
                  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                  <h5><i class="icon fas fa-check"></i> 质量预测!</h5>
                  当前生产参数设置合理，预计良率将保持在98%以上。
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </div>

  <!-- Main Footer -->
  <footer class="main-footer">
    <div class="float-right d-none d-sm-block">
      <b>Version</b> 1.0.0
    </div>
    <strong>Copyright &copy; 2024 <a href="#">智能制造分析系统</a>.</strong> All rights reserved.
  </footer>
</div>

<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Bootstrap 4 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="https://cdn.jsdelivr.net/npm/admin-lte@3.2.0/dist/js/adminlte.min.js"></script>
<!-- Select2 -->
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<!-- Chart.js -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.7.0/dist/chart.min.js"></script>

<script>
  $(function () {
    // 初始化Select2
    $('.select2').select2({
      theme: 'bootstrap4'
    });

    // 生产趋势图表
    var productionTrendCtx = document.getElementById('productionTrendChart').getContext('2d');
    var productionTrendChart = new Chart(productionTrendCtx, {
      type: 'line',
      data: {
        labels: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00'],
        datasets: [{
          label: '实际产量',
          data: [20, 35, 45, 55, 65, 75, 85, 95],
          borderColor: 'rgb(75, 192, 192)',
          tension: 0.1
        }, {
          label: '计划产量',
          data: [25, 40, 50, 60, 70, 80, 90, 100],
          borderColor: 'rgb(255, 99, 132)',
          borderDash: [5, 5],
          tension: 0.1
        }]
      },
      options: {
        responsive: true,
        maintainAspectRatio: false,
        scales: {
          y: {
            beginAtZero: true
          }
        }
      }
    });

    // 生产状态图表
    var productionStatusCtx = document.getElementById('productionStatusChart').getContext('2d');
    var productionStatusChart = new Chart(productionStatusCtx, {
      type: 'doughnut',
      data: {
        labels: ['运行中', '待机', '维护', '故障'],
        datasets: [{
          data: [70, 15, 10, 5],
          backgroundColor: [
            'rgb(75, 192, 192)',
            'rgb(255, 205, 86)',
            'rgb(54, 162, 235)',
            'rgb(255, 99, 132)'
          ]
        }]
      },
      options: {
        responsive: true,
        maintainAspectRatio: false
      }
    });
  });
</script>
</body>
</html> 